// 第二个部署
// 1、需要在合约里面限制奋斗狗NFT的发行数量(部署时完成)
// 2、需要设置稀有度的枚举 (部署时完成)
// 3、需要根据盲盒TokenId设置盲盒对应的概率 (部署后完成)  addBlindBoxRarityPR
// [["SR", 1000, 1], ["SSR", 2000, 2], ["UR", 4000, 3]]
//
// // 4、需要设置盲盒BindBox,只有盲盒才能调用随机合约(部署后完成) setBindBox
// // gas: 0.03
// test address: 0xd0B335daCc0dB3Ed59046F5f213d6B51671DeFE5
const { BigNumber } = require('ethers');

async function main() {
    const SR = {weightsName: "SR", enumId: 1, issued: 0, totalSupply:6000};
    const SSR = {weightsName: "SSR", enumId: 2, issued: 0, totalSupply:3000};
    const UR = {weightsName: "UR", enumId: 3, issued: 0, totalSupply:1000};
    const token_limit = 10000;  //NFT 发行数量

    const Lottery = await ethers.getContractFactory("Lottery");
    const instance = await upgrades.deployProxy(Lottery, [token_limit,[1,2,3],[SR,SSR,UR]], {initializer:'__Lottery_init'});
    await instance.deployed();
    console.log("Lottery deployed to:", instance.address);
}

main()
    .then(() => process.exit(0))
    .catch((error) => {
        console.error(error);
        process.exit(1);
    });
